<%page expression_filter="h"/>
<%!
from django.urls import reverse
from django.utils.translation import gettext as _
from openedx.core.djangolib.markup import HTML, Text
%>

<%
def _message(reqm, message):
    return Text(message).format(link=HTML("<a href={url}>{url_name}</a>").format(
        url = reverse('jump_to', kwargs=dict(course_id=str(reqm.course_id),
                        location=str(reqm.location))),
        url_name = reqm.display_name_with_default))
%>
% if message:
    % for reqm in module.get_required_blocks:
        % if reqm:
            <p class="conditional-message">${_message(reqm, message)}</p>
        % else:
            <p class="conditional-message">
                ${_("You do not have access to this dependency block.")}
            </p>
        % endif
    % endfor
% endif
